from datetime import datetime

import akshare as ak

NEED_RANK_NUM = 20

now = datetime.now()
# 格式化为字符串（如"2025-07-27 15:30:00"）
date_string = now.strftime("%Y-%m-%d")

# 板块资金流排名
sector_fund_rank = ak.stock_sector_fund_flow_rank()
sector_fund_rank_20 = sector_fund_rank.head(NEED_RANK_NUM)

sector_fund_rank_20.to_excel("../excel/"+ date_string+'.xlsx', index=False)

# # 概念资金流排名
# symbol_fund_rank = ak.stock_sector_fund_flow_rank(indicator= "今日", sector_type = "概念资金流")
# symbol_fund_rank_20 = symbol_fund_rank.head(NEED_RANK_NUM)
#
#
# # 个股资金流
# individual_fund_flow_rank = ak.stock_individual_fund_flow_rank()
# individual_fund_flow_rank_20 = individual_fund_flow_rank.head(20)



# 接口: stock_zt_pool_strong_em
# 目标地址: https://quote.eastmoney.com/ztb/detail#type=qsgc
# 描述: 东方财富网-行情中心-涨停板行情-强势股池